using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using DATA.BusinessObjects;
using DATA.Base;

namespace DATA.ManagerObjects
{
    public partial interface IChitietmatdosudungphongManager : IManagerBase<DATA.BusinessObjects.Chitietmatdosudungphong, string>
    {
		// Get Methods
		IList<Chitietmatdosudungphong> GetByMaMatDoSuDungPhong(System.String matdosudungphong);
		IList<Chitietmatdosudungphong> GetByMaPhong(System.String phong);
    }

    partial class ChitietmatdosudungphongManager : ManagerBase<DATA.BusinessObjects.Chitietmatdosudungphong, string>, IChitietmatdosudungphongManager
    {
		#region Constructors
		
		public ChitietmatdosudungphongManager() : base()
        {
        }
        public ChitietmatdosudungphongManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Chitietmatdosudungphong> GetByMaMatDoSuDungPhong(System.String matdosudungphong)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Chitietmatdosudungphong));
			
			
			ICriteria matdosudungphongCriteria = criteria.CreateCriteria("Matdosudungphong");
            matdosudungphongCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", matdosudungphong));
			
			return criteria.List<Chitietmatdosudungphong>();
        }
		
		public IList<Chitietmatdosudungphong> GetByMaPhong(System.String phong)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Chitietmatdosudungphong));
			
			
			ICriteria phongCriteria = criteria.CreateCriteria("Phong");
            phongCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", phong));
			
			return criteria.List<Chitietmatdosudungphong>();
        }
		
		#endregion
    }
}